<?php
include('config.php');
$type_name = isset($_POST['type_name']) ? $_POST['type_name'] : '';
$name_name = isset($_POST['name']) ? $_POST['name'] : '';
$number_name = isset($_POST['number_name']) ? $_POST['number_name'] : '';
$rs = $mysql->selectList('breed',"breed_name='{$name_name}'");
$where = "breed_id={$rs[0]['breed_id']}";
//$result = $mysql->selectList('breed',$where);
if($rs){
	$result = $mysql->selectCount('number',"number_name='{$number_name}'");
	if($result){
		echo "0";
	}else{
		$data = array('type_id'=>$rs[0]['type_id'],'breed_id'=>$rs[0]['breed_id'],'number_name'=>$number_name);
		$id = $mysql->insert('number',$data);
		if($id>0){
			echo "1";
		}else{
			echo -1;
		}
	}
}